from PyQt4 import QtGui
from PyQt4.QtCore import Qt
from .image_button import ImageButton

class LiftPlate(QtGui.QWidget):
        def __init__(self, *args, **kw):
		QtGui.QWidget.__init__(self, *args, **kw)
		self.setGeometry(0, 0, 214, 83)

		bg = QtGui.QLabel(self) 
		bg.setGeometry(0, 0, 214, 83)
		path = "resources/lift_plate.png"
		bg.setPixmap(QtGui.QPixmap(path))

		self.up_b = ImageButton("up_butt", self,
			"resources/lift_up.png",
			"resources/lift_up_h.png",
			"resources/lift_up_d.png",
			"resources/lift_up.png"
		)
                self.up_b.setGeometry(146,21,38,38)

		self.down_b = ImageButton("down_butt", self,
			"resources/lift_down.png",
			"resources/lift_down_h.png",
			"resources/lift_down_d.png",
			"resources/lift_down.png"
		)
                self.down_b.setGeometry(27,21,38,38)

	def set_cbs(self, up, down):
		self.up_b.clicked.connect(up)
		self.down_b.clicked.connect(down)

if __name__ == "__main__":
	import sys

	app = QtGui.QApplication(sys.argv)

	top = QtGui.QLabel()
	top.setGeometry(0, 0, 260, 128)
	path = "resources/wood.jpg"
	top.setPixmap(QtGui.QPixmap(path))

	screen = LiftPlate(top)
	screen.move(20,20)

	top.show()
	sys.exit(app.exec_())


